A NAN is a standard defined by the Wireless Fidelity Alliance (WFA). A function of the standard is to synchronize all devices joining the NAN network without a central node and to perform maintenance work and service discovery work of the NAN network in an agreed discovery window (DW).
After a device completes service discovery, the device needs to establish data communication with a target device. In NAN 2.0, a NAN data link (NDL) needs to be established for data communication between devices. The conventional NAN technology supports only service discovery and data transmission between devices within a one-hop range (within a wireless transmission distance, it may also be understood that no forwarding is required during data transmission), but does not support service discovery and data transmission between devices within a multi-hop range (beyond the wireless transmission distance, it may also be understood that data needs to be forwarded to arrive at a target device). In conventional multi-hop data transmission modes in other networks, a device needs to establish a multi-hop path with a target device, and then perform data transmission by using the path. If a conventional multi-hop path discovery method in other networks is directly used, a connection needs to be first established between every two NAN devices. A process of establishing a connection relationship needs to consume a large quantity of air interface messages. However, the NAN network has a loose structure, and devices can communicate without establishing a connection relationship. In addition, a path discovery process and a path establishment process both need to consume a large quantity of air interface messages, and occupy a large quantity of time-frequency resources.